package wechat.custapp;

import com.google.common.base.Objects;
import wechat.custapp.WCCorpCustApplication;

@SuppressWarnings("all")
public class WXCorpCustAppFactory {
  private static WCCorpCustApplication customerApp = null;
  
  public static WCCorpCustApplication getDefaultCorpApp() {
    WCCorpCustApplication _xblockexpression = null;
    {
      boolean _equals = Objects.equal(WXCorpCustAppFactory.customerApp, null);
      if (_equals) {
        WCCorpCustApplication _wCCorpCustApplication = new WCCorpCustApplication("wx59b4783059880985", "6YC23FwHm6-pEArDeGFGL2w6jNYddWitbT8o28VnOeU", "1000002");
        WXCorpCustAppFactory.customerApp = _wCCorpCustApplication;
      }
      _xblockexpression = WXCorpCustAppFactory.customerApp;
    }
    return _xblockexpression;
  }
  
  public static WCCorpCustApplication createCorpCustApp(final String corp_id, final String secret, final String agent_id) {
    WCCorpCustApplication _xblockexpression = null;
    {
      boolean _equals = Objects.equal(WXCorpCustAppFactory.customerApp, null);
      if (_equals) {
        WCCorpCustApplication _wCCorpCustApplication = new WCCorpCustApplication(corp_id, secret, agent_id);
        WXCorpCustAppFactory.customerApp = _wCCorpCustApplication;
      }
      _xblockexpression = WXCorpCustAppFactory.customerApp;
    }
    return _xblockexpression;
  }
  
  public static WCCorpCustApplication forceNewCorpCustApp(final String corp_id, final String secret, final String agent_id) {
    WCCorpCustApplication _xblockexpression = null;
    {
      WCCorpCustApplication _wCCorpCustApplication = new WCCorpCustApplication(corp_id, secret, agent_id);
      WXCorpCustAppFactory.customerApp = _wCCorpCustApplication;
      _xblockexpression = WXCorpCustAppFactory.customerApp;
    }
    return _xblockexpression;
  }
}
